package br.eng.eliseu.gwt.aconchego.camera.module;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.google.gwt.user.client.rpc.IsSerializable;


@Entity
@Table(name="CAMERA")
@SequenceGenerator(name="SEQ_CAMERA", sequenceName="SEQ_CAMERA")
@NamedQueries({
	@NamedQuery(name="camera.selectTudo", query="select q from Camera q "),
	@NamedQuery(name="camera.selectStatus", query="select q from Camera q where q.status = :status "),
})
public class Camera implements Serializable, IsSerializable {

	private static final long serialVersionUID = -5546783156485454420L;

	public Camera() {}
	
	public Camera(String nome, String comando, StatusCamEnum status) {
		setNome(nome);
		setComando(comando);
		setStatus(status);
	}
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;

	private String nome;
	
	private String comando;

	@Enumerated(EnumType.STRING)
	private StatusCamEnum status;
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getComando() {
		return comando;
	}

	public void setComando(String comando) {
		this.comando = comando;
	}

	public StatusCamEnum getStatus() {
		return status;
	}

	public void setStatus(StatusCamEnum status) {
		this.status = status;
	}

	
}
